package lu.med.praxiswahl.wahlumed.client.patienten;

import lu.med.praxiswahl.wahlumed.client.utilities.Parser;

/**
 * 
 * @author Lars Holger Roth
 */
public class PatientExtraData
{
    private String[] buffer = new String[100];

    public PatientExtraData()
    {
	preset();
    }

    public PatientExtraData(String com)
    {
	preset();
	String[] tok = Parser.parseString(com);
	for (int i = 0; i < tok.length; i++)
	{
	    buffer[i] = tok[i];
	}
    }

    @Override
    public PatientExtraData clone()
    {
	String p = this.toString();
	// Klammern entfernen
	p = p.substring(1, p.length() - 1);
	return new PatientExtraData(p);
    }

    public String getAdresseHausarzt()
    {
	return buffer[0];
    }

    public String getAlteAdresse()
    {
	return buffer[6];
    }

    public String getNameMutter()
    {
	return buffer[5];
    }

    public String getNameVater()
    {
	return buffer[4];
    }

    public String getVersichertMutter()
    {
	return buffer[3];
    }

    public String getVersichertSelbst()
    {
	return buffer[1];
    }

    public String getVersichertVater()
    {
	return buffer[2];
    }

    public String getWebsite()
    {
	return buffer[7];
    }

    public void preset()
    {
	for (int i = 0; i < buffer.length; i++)
	    buffer[i] = "";
    }

    public void setAdresseHausarzt(String val)
    {
	buffer[0] = val;
    }

    public void setAlteAdresse(String val)
    {
	buffer[6] = val;
    }

    public void setNameMutter(String val)
    {
	buffer[5] = val;
    }

    public void setNameVater(String val)
    {
	buffer[4] = val;
    }

    public void setVersichertMutter(String val)
    {
	buffer[3] = val;
    }

    public void setVersichertSelbst(String val)
    {
	buffer[1] = val;
    }

    public void setVersichertVater(String val)
    {
	buffer[2] = val;
    }

    public void setWebsite(String val)
    {
	buffer[7] = val;
    }

    @Override
    public String toString()
    {
	String str = "(";
	// Adresse vom Hausarzt
	str += buffer[0] + "#";
	// Versichert Selbst
	str += buffer[1] + "#";
	// Versichert Vater
	str += buffer[2] + "#";
	// Versichert Mutter
	str += buffer[3] + "#";
	// Name Vater
	str += buffer[4] + "#";
	// Name Mutter
	str += buffer[5] + "#";
	// �ltere Adressen
	str += buffer[6] + "#";
	// Website
	str += buffer[7] + ")";
	return str;
    }
}
